<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Cadastrar componente no Repositório</title>
	</head>
	<body>
		<h1>Cadastre um novo componente no Repositório</h1>
		<c:if test="${!empty errors}">
			<c:forEach var="error" items="${errors}">
				<p>${error.category}: ${error.message}</p>
			</c:forEach>
		</c:if>
		<form method="post" action="<c:url value="/repository/component/new" />" enctype="multipart/form-data">
			<ul>
				<li>Nome: <input type="text" name="component.name" value="${component.name}" /></li>
				<li>Descrição: <textarea name="component.description">${component.description}</textarea></li>
				<li>Versão: <input type="text" name="component.version" value="${component.version}" /></li>
				<li>Arquivo APK: <input type="file" name="componentUploadedFile" /></li>
				<li><input type="submit" value="Cadastrar" /></li>
			</ul>
		</form>
		<a href="<c:url value="/repository" />">Cancelar</a>
	</body>
</html>